#!/usr/bin/env bash

# Author:   Zhang Huangbin (michaelbibby <at> gmail.com)

#---------------------------------------------------------------------
# This file is part of iRedMail, which is an open source mail server
# solution for Red Hat(R) Enterprise Linux, CentOS, Debian and Ubuntu.
#
# iRedMail is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# iRedMail is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with iRedMail.  If not, see <http://www.gnu.org/licenses/>.
#---------------------------------------------------------------------

# Warning: Please source 'conf/postfix' first.

export AMAVISD_SERVER='127.0.0.1'
export AMAVISD_USER='amavis'
export AMAVISD_GROUP='amavis'
export AMAVISD_LOGFILE='/var/log/amavisd.log'
export AMAVISD_LOGROTATE_FILE="${LOGROTATE_DIR}/amavisd"
export AMAVISD_DKIM_DIR='/var/lib/dkim'
export AMAVISD_DKIM_SELECTOR='dkim'
export AMAVISD_DAEMON_USER='amavis'
export AMAVISD_DAEMON_GROUP='amavis'

# Altermime.
export ALTERMIME_BIN='/usr/bin/altermime'
export DISCLAIMER_DIR="${POSTFIX_ROOTDIR}/disclaimer"

if [ X"${DISTRO}" == X"RHEL" ]; then
    export AMAVISD_BIN='amavisd'
    export AMAVISD_CONF='/etc/amavisd.conf'
    export AMAVISD_DKIM_CONF='/etc/amavisd.conf'
    export AMAVISD_RC_SCRIPT_NAME='amavisd'
elif [ X"${DISTRO}" == X"DEBIAN" -o X"${DISTRO}" == X"UBUNTU" ]; then
    export AMAVISD_BIN='amavisd-new'
    export AMAVISD_CONF_DIR='/etc/amavis/conf.d'
    export AMAVISD_CONF='/etc/amavis/conf.d/50-user'
    export AMAVISD_DKIM_CONF='/etc/amavis/conf.d/50-user'
    export AMAVISD_RC_SCRIPT_NAME='amavis'
else
    :
fi

# Syslog setting, 'YES' or 'NO'
export AMAVISD_SEPERATE_LOG='NO'
